import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/index'
  },{
    path: '/index',
    name: 'index',
    component: () => import('../views/index')
  },{
    path: '/movie-info',
    name: 'movieinfo',
    component: () => import('../views/movieinfo')
  },{
    path: '/login',
    name: 'login',
    component: () => import('../views/admin/login')
  },{
    path: '/admin',
    name: 'admin',
    component: () => import('../views/admin/admin'),
    children:[
      {
        path: 'list-movie',
        name: 'movielist',
        component: () => import('../views/admin/movies/movielist')
      },{
        path: 'create-movie',
        name: 'moviecreate',
        component: () => import('../views/admin/movies/moviecreate')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
